'''
Company: TWL
Author: xue jian
Email: xuejian@kanzhun.com
Date: 2020-11-26 09:42:36
'''
#
# @lc app=leetcode.cn id=164 lang=python3
#
# [164] 最大间距
#

# @lc code=start
from typing import List
class Solution:
    def maximumGap(self, nums: List[int]) -> int:
        nums.sort()
        ans=0
        for i in range(len(nums)):
            if not i:
                continue
            ans=max(ans, nums[i]-nums[i-1])
        return ans
# @lc code=end

